<html>
<head>
    <#assign basePath=request.contextPath>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <#include "/WEB-INF/views/template/bootMainJs.ftl" parse=true encoding="utf-8">
    <!-- bootstrap-datetimepicker -->
    <link href="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/form.lzy.css" rel="stylesheet">
</head>
<body>

<input id="p_view"  value="1" type="hidden">

<div class="content-header">
    <h5>平台 &gt; 基础数据管理 &gt; <strong>审核流程管理</strong></h5>
</div>

<div class="panel panel-lzy">
    <div class="panel-body">
        <h5 class="tips-lzy">操作提示</h5>
        <ul class="tips-list-lzy">
            <li><span>◆&nbsp;该页面显示了平台所有的审核申请，可对审核进行查看编辑操作。</span></li>
            <li><span>◆&nbsp;可输入关键字或选择项进行相关查询（可单项查询）。</span></li>
        </ul>
    </div>
</div>

<div class="panel panel-f5">
    <div class="panel-body row item-right">
        <form id="myForm" class="form-inline form-margin-right">
            <div class="form-group">
                <span>审核事件：</span>
                <select class="form-control required" id="auditEventId">
                    <option value="" >请选择</option>
                    <option value="" >认证</option>
                    <option value="" >上传商品</option>
                    <option value="" >上传底盘</option>
                </select>
            </div>
            <div class="form-group">
                <button type="button" class="btn btn-primary btn-sm" onclick="search(1)">查询</button>
            </div>
        </form>
    </div>
    <div class="panel-heading row">
        <button type="button" class="btn btn-primary" onclick="add();"><span class="fa fa-plus"></span> 新增</button>
    </div>
    <!-- 分页查询的地址-->
    <div class="panel-body panel-white">
        <div class="table-responsive">
            <table id="myTable"
                   class="table table-hover"
                   data-url="${basePath}/admin/process/json"
                   data-pageSize="10,50,100" data-method="GET">
                <thead>
                <tr>
                    <th data-type="xuhao" >序号</th>
                    <th data-field="submitTime">审核事件</th>
                    <th data-field="applicantName">审核流程</th>
                    <th data-field="button" data-call="true">操作</th>
                    <th data-field="processStatus" data-call="true">状态</th>
                </tr>
                </thead>
                <tbody id="tbodyId">
                </tbody>
            </table>
        </div>
        <!-- 分页条-->
        <div class="row">
            <div align="left" class="col-xs-6">
                <div class="input-group">
                    <span class="input-group-addon" id="pageCount"></span>
                    <select id="pageSize" onchange="search(1)" class="form-control" style="width: 100px"></select>
                </div>
            </div>
            <div align="right" class="col-xs-6">
                <ul class="pagination" id="pagination"></ul>
            </div>
        </div>
    </div>
</div>

<#include "/WEB-INF/views/template/bootMainJs.ftl" parse=true encoding="utf-8">
<script type="text/javascript" src="${basePath}/bootstrap/js/utils.js" type="text/javascript"></script>
<script type="text/javascript" src="${basePath}/bootstrap/plugin/jqPaginator/jqPaginator.js"></script>
<script type="text/javascript" src="${basePath}/bootstrap/plugin/jqPaginator/myPage.js"></script>
<!-- bootstrap-datetimepicker -->
<script type="text/javascript" src="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="${basePath}/bootstrap/plugin/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">

    // 循环列表数据以及操作按钮
    function tableCallBack(data, id){
        if(id == 'processStatus') {
            if (data.processStatus == 0) {
                return '<span class="text-blue">已禁用</span>';
            } else if (data.processStatus == 1) {
                return '<span class="text-red">已启用</span>';
            }
        } else if(id == 'button') {
            // 增加操作按钮
            var _button = '';
            var count = 0;
            if ($('#p_view').val() == 1) {
                _button += '<button type="button" class="btn btn-white btn-xs" onclick="edit(\'' + data.id + '\');">编辑 </button> ';
                count ++
            }

            return _button;
        } else {
            if(data[id] == null || data[id] == ''){
                return '';
            } else {
                return data[id];
            }
        }
    }

    // 编辑
    function edit(id){
        location.href = "${basePath}/admin/process/edit?id=" + id;
    }
    // 新增
    function add(){

    }
</script>
</body>
</html>